import static java.lang.Thread.sleep;

public class Productor implements Runnable{

    private box b;

    public Productor(box b) {
        this.b = b;
    }

    @Override
    public void run() {
        try {
            while(true) {
                b.product();
                System.out.println("生产");
                sleep(1000);
            }
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }
}
